.inner
  h4.subtitled
    .sub(ng-if="!currentUser") Neo4j Browser Sync
    .sub(ng-if="currentUser") {{currentUser.name}}
      small(ng-if='syncService.inSync && currentUser') Synced&nbsp;
        span(am-time-ago='syncService.lastSyncedAt')
      small.error(ng-if='!syncService.inSync && currentUser', ng-click='syncService.push()')
        a Out of sync
      small(ng-show='syncService.hasConnection') Connected
      small(ng-hide='syncService.hasConnection') Not Connected

  h5(ng-if="currentUser") Versions
  div(ng-if="currentUser")
    p You have access to the last 5 versions, in case you want to restore to an older version.
    div(ng-repeat="key in syncService.syncKeys", ng-controller="SyncVersionRestoreKeyCtrl")
      h6(style="margin-top: 15px") {{key.display | uppercase}}
      select.form-control.version-select(ng-options="val.syncedAt as ((val.syncedAt | toYYYYMMDDHis) + ' (' + val.client + ')') for val in ntn_data[key.value]",
        ng-model="pickedTimestamp"
      )
        option No saved version available
      button.btn.btn-popup.restore-button(ng-click="syncService.restoreToVersion(key.value, pickedTimestamp, removeElementCallback(this))",
        ng-show="pickedTimestamp && pickedTimestamp != ntn_data[key.value][0].syncedAt"
      )
        | Restore
      .clearfix

  h5 Manage local data
  .local-data-holderdiv(ng-if="!currentUser")
    .local-data-confirm(ng-show="!clearSingleClicked")
      p
        | This will reset your local storage, clearing favorite scripts, grass, command history and settings.
      div
        button.btn.btn-popup(ng-click="updateClearSingleClicked(1)") Clear local data &nbsp;
          i.sl.sl-bin
    .local-data-confirm(ng-show="clearSingleClicked")
      div
        p
          b WARNING:&nbsp;
          | This WILL erase your data stored in this web browsers local storage.
        p
          | What do you want to do?
          br
          span.small (nothing, &nbsp;
            a(ng-click="updateClearSingleClicked(0)") cancel
            | )
      div
        button.btn.btn-popup.btn-non-destructive(ng-click="signoutAndClearLocalStorage()") Clear local data

  .local-data-holderdiv(ng-if="currentUser")
    .local-data-confirm(ng-show="!clearSingleClicked")
      p
        | This will clear your favourite scripts, grass, command history etc. locally.
      div
        button.btn.btn-popup(ng-click="updateClearSingleClicked(1)") Clear local data &nbsp;
          i.sl.sl-bin
    .local-data-confirm(ng-show="clearSingleClicked")
      div
        p
          b WARNING:&nbsp;
          | If you don't sign out from Neo4j Browser Sync first, the sync servers data could be cleared as well.
          | Your data could be lost.
        p
          | What do you want to do?
          br
          span.small (nothing, &nbsp;
            a(ng-click="updateClearSingleClicked(0)") cancel
            | )
      div
        button.btn.btn-popup.btn-non-destructive(ng-click="signoutAndClearLocalStorage()") Sign out + clear

  div(ng-if="currentUser && syncService.hasConnection")
    p &nbsp;
    p
      button.btn.btn-popup.btn-destructive(ng-click="CurrentUser.logout(); toggleDrawer('profile') ") Sign out

  div(ng-if="!currentUser && syncService.hasConnection", ng-controller="SyncSigninController")
    p &nbsp;
    h5 Sign In or Register
    p Neo4j Browser Sync is a companion cloud service for Neo4j Browser. Connect through a simple social sign-in
      | to get started.
    p 
      a(play-topic="neo4j-sync") About Neo4j Browser Sync
    alert.top-padded(ng-hide="goodBrowser") 
      | Neo4j Browser Sync is currently only available for some versions of Internet Explorer.
      | If you have any trouble, we'd love to hear from you at&nbsp;
      a(href="mailto:feedback@neotechnology.com")
        | feedback@neotechnology.com
    button.btn.btn-popup(ng-click="signInToSync()") Sign In / Register
    .box-max
      .checkbox
        label.muted(for="acceptedTermsAndPrivacyCheckBox")
          input#acceptedTermsAndPrivacyCheckBox(type="checkbox", ng-model="settings.acceptedTermsAndPrivacy", ng-change="save()")
          | By checking this box you are agreeing to the 
          a(href="http://neo4j.com/terms/neo4j-browser-sync/") Neo4j Browser Sync Terms of Use
          | &nbsp;and our&nbsp;
          a(href="http://neo4j.com/privacy-policy/") Privacy Policy
          |.  
    alert(ng-show='showSignupWarning', close="closeWarning()") Before you can sign in, please check the box above to agree to the terms of use and privacy policy.

  div.connection-error(ng-if="!syncService.hasConnection && !currentUser")
    p &nbsp;
    p It is not possible to connect to Neo4j Browser Sync right now.

footer
  p What's this?&nbsp;
    a(href="http://neo4j.com/neo4j-browser-sync") Learn More
